var express = require('express');
var router = express.Router();

const upload = require('./utils/multer');

const medicalPlan = require('./controller/medicalPlanController')
const packageType = require('./controller/packageTypeController')
const physicalExaminationProject = require('./controller/physicalExaminationProjectController')
const AppointmentMedical = require('./controller/appointmentMedicalController')

router.get('/getMedicalPlan', medicalPlan.getMedicalPlan);
//单文件上传
router.post('/upload1', upload.single('file'), (req, res) => {
    console.log(req.file);
    res.send({
        code: 200,
        path: req.file.filename
    })
})

//多文件上传
router.post('/upload2', upload.array('bbb', 3), (req, res) => {
    console.log(req.files);
    res.send({
        code: 200,
        data: req.files
    })
})
router.post('/addMedicalPlan', medicalPlan.addMedicalPlan);
router.post('/delMedicalPlan', medicalPlan.delMedicalPlan);
router.get('/getMedicalName', medicalPlan.getMedicalName);
router.post('/delAllMedicalPlan', medicalPlan.delAllMedicalPlan);

router.get('/getPackageType', packageType.getPackageType);
router.post('/addPackageType', packageType.addPackageType);
router.post('/delPackageType', packageType.delPackageType);
router.get('/getTypeName', packageType.getTypeName);

router.get('/getPhysicalExaminationProject', physicalExaminationProject.getPhysicalExaminationProject);
router.get('/getProjectName', physicalExaminationProject.getProjectName);
router.post('/addPhysicalExaminationProject', physicalExaminationProject.addPhysicalExaminationProject);
router.post('/delPhysicalExaminationProject', physicalExaminationProject.delPhysicalExaminationProject);
router.post('/delAllPhysicalExaminationProject', physicalExaminationProject.delAllPhysicalExaminationProject)

router.get('/getAppointmentMedical', AppointmentMedical.getAppointmentMedical);

module.exports = router;